package com.report.reportserver.service.impl;

import com.report.reportserver.mapper.YamlModelMapper;
import com.report.reportserver.model.YamlModel;
import com.report.reportserver.service.YamlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yaml.snakeyaml.Yaml;

import java.util.*;

/**
 * @ ClassName: YamlServiceImpl
 * @ Description：
 * @ Modified By：
 * @ Version:
 * @ Author     ：LiYing
 * @ Date       ：Created in 10:47 2022/3/1
 */
@Service
public class YamlServiceImpl implements YamlService {

    @Autowired
    YamlModelMapper yamlModelMapper;

    @Override
    public YamlModel queryYamlById(Integer id) {
        YamlModel yaml = yamlModelMapper.selectByPrimaryKey(id);
        return yaml;
    }

    @Override
    public YamlModel queryYamlByName(String name) {
        YamlModel yaml = yamlModelMapper.selectByName(name);
        return yaml;
    }

    @Override
    public YamlModel queryYamlByUserName(String name) {
        return null;
    }

    @Override
    public List<String> queryYamlByType(int type) {
        List<String> list = yamlModelMapper.selectByType(type);
        return list;
    }

    @Override
    public void insertYaml(YamlModel yaml) {
        yamlModelMapper.insert(yaml);
    }


}
